package com.jic.member.job;

import com.jic.member.service.TripService;
import com.jic.member.service.TripTimingJobService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yinhaijun
 * @date: 2020/6/8
 */
@RestController
@Slf4j
@RequestMapping("/tripTiming")
@Api(tags = " [定时任务]旅程")
public class TripTimingJobServiceController {

    @Autowired
    private TripService tripService;

    @Autowired
    private TripTimingJobService tripTimingJobService;

    @ApiOperation(value = "旅程的固定定时任务，3分钟被调用一次")
    @RequestMapping(value = "job", method = RequestMethod.GET)
    public void job(){
        tripTimingJobService.process();
    }

    @ApiOperation(value = "测试：保存旅程")
    @RequestMapping(value = "save/listByPageTrip", method = RequestMethod.GET)
    public void saveTrip(Long id){
        tripService.saveTest(id);
    }




}
